package com.jssj.service.impl;

import java.util.HashMap;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.jssj.dao.JssjDao;
import com.jssj.service.JssjService;
import com.jssj.util.BaseResultBean;

@Service("jssjServiceImpl")
public class JssjServiceImpl implements JssjService{
	@Autowired
	private JssjDao jssjDao;
	
	@Override
	public BaseResultBean findByTime(String startTime, String endTime)  {
		BaseResultBean baseResultBean = new BaseResultBean();
		Map<String, Object> param = new HashMap<String, Object>();
		param.put("startTime", startTime);
		param.put("endTime", endTime);
		baseResultBean.setResultCode(BaseResultBean.SUCCESS);
		baseResultBean.setData(this.jssjDao.selectInfoByCondition(param));
		return baseResultBean;
	}

	@Override
	public BaseResultBean findByScore(String score)  {
		BaseResultBean baseResultBean = new BaseResultBean();
		Map<String, Object> param = new HashMap<String, Object>();
		param.put("score", score);
		baseResultBean.setResultCode(BaseResultBean.SUCCESS);
		baseResultBean.setData(this.jssjDao.selectInfoByCondition(param));
		return baseResultBean;
	}

	@Override
	public BaseResultBean findBySchool(String school)  {
		BaseResultBean baseResultBean = new BaseResultBean();
		Map<String, Object> param = new HashMap<String, Object>();
		param.put("university_name", school);
		baseResultBean.setResultCode(BaseResultBean.SUCCESS);
		baseResultBean.setData(this.jssjDao.selectInfoByCondition(param));
		return baseResultBean;
	}

	@Override
	public BaseResultBean findByAddress(String address)  {
		BaseResultBean baseResultBean = new BaseResultBean();
		Map<String, Object> param = new HashMap<String, Object>();
		param.put("address", address);
		baseResultBean.setResultCode(BaseResultBean.SUCCESS);
		baseResultBean.setData(this.jssjDao.selectInfoByCondition(param));
		return baseResultBean;
	}

	@Override
	public BaseResultBean findByCondition(String score, String address, String professional, String provinces)
			 {
		BaseResultBean baseResultBean = new BaseResultBean();
		Map<String, Object> param = new HashMap<String, Object>();
		param.put("score", score);
		param.put("address", address);
		param.put("professional", professional);
		param.put("provinces", provinces);
		baseResultBean.setResultCode(BaseResultBean.SUCCESS);
		baseResultBean.setData(this.jssjDao.selectInfoByCondition(param));
		return baseResultBean;
	}

}
